home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 361_01 / saverest.c < prev    next >
C/C++ Source or Header  |  1991-09-18  |  922b  |  36 lines

  1.  
  2. /*SaveRest.c ---> Save/Restore a Rectangular Area of CRT Text.
  3.  *
  4.  * Author: J.Ekwall                                     13 September 91
  5.  *
  6.  * Copyrighted to the Public Domain.  Unlimited Distribution Authorized.
  7.  *
  8.  * User Assumes All Risks/Liabilities.
  9.  *
  10.  * Last Update: 13 September 91/EK
  11.  */
  12.  
  13. #include <stdek.h>
  14. #include <gadgets.h>
  15.  
  16. void RestoreBox(int Left, int Top, int Right, int Bottom, char *FootPrint)
  17. {
  18.     int X, Y, Addr, *tp1;
  19.  
  20.     for (Y = Top, tp1 = (int *) FootPrint; Y <= Bottom; Y++) {
  21.        Addr = Vaddr(Left, Y);
  22.        for (X = Left; X++ <= Right; Addr += 2) Vpoke(Addr, *tp1++);
  23.     }
  24. }
  25.  
  26. void SaveBox(int Left, int Top, int Right, int Bottom, char *FootPrint)
  27. {
  28.     int X, Y, Addr, *tp1;
  29.  
  30.     for (Y = Top, tp1 = (int *) FootPrint; Y <= Bottom; Y++) {
  31.        Addr = Vaddr(Left, Y);
  32.        for (X = Left; X++ <= Right; Addr += 2) *tp1++ = Vpeek(Addr);
  33.     }
  34. }
  35.  
  36.